package com.woniuxy.moneyapp.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.woniuxy.commons.util.Result;
import com.woniuxy.moneyapp.client.param.*;
import io.seata.spring.annotation.GlobalTransactional;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.UnsupportedEncodingException;


@FeignClient(name = "fund",path = "/fundPath",contextId = "ReturnCashClient")
@Component
//第一个是context path 第二个是
public interface ReturnCashClient {

    @ApiOperation("正常退款")
    @PostMapping("/returnCash/regularRefund")
        //缺个动态添加计时任务 判断订单状态是否为10 为10 记录到payrecord和流水表里 不成功 更改门店状态
    Result regularRefund(@RequestBody @Valid BalanceRefundForm bp) throws JsonProcessingException, UnsupportedEncodingException;

    @ApiOperation("发起退款")
    @PostMapping("/returnCash/sendRefundRequest")
        //缺个动态添加计时任务 判断订单状态是否为10 为10 记录到payrecord和流水表里 不成功 更改门店状态
    Result sendRefundRequest(@RequestBody @Valid SendRefundRequest srr) ;
}
